<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JavaScript更改样式</title>
</head>
<body>
<button type="button" onclick="oneFunction()">更改样式</button>
<p id="demo">默认样式</p>
<script>
    function oneFunction(){
        document.getElementById("demo").style.fontSize="30px";
        document.getElementById("demo").style.color="yellow";
        document.getElementById("demo").style.background="pink";
    }
</script>
</body>
</html>